package com.originskyseed.platform.user.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.user.model.AnchorProfitVO;
import com.originskyseed.platform.user.model.AnchorRelateLive;

/**
 * 主播直播信息表Mapper类（OSI_ANCHOR_RELATE_LIVE）
 *
 * @author Tangwanghui
 */
public interface AnchorRelateLiveMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(AnchorRelateLive record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(AnchorRelateLive record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(AnchorRelateLive record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(AnchorRelateLive record) throws Exception;

	/**
	 * 更新记录,月表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateMonthByPrimaryKeySelective(AnchorRelateLive record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public AnchorRelateLive selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<AnchorRelateLive> selectList(AnchorRelateLive record) throws Exception;


	/**
	 * 主播id
	 *
	 * @param liveId
	 * @return
	 * @throws Exception
	 */
	public AnchorRelateLive selectByLiveId(@Param("liveId") String liveId) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<AnchorRelateLive> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(List<AnchorRelateLive> list) throws Exception;

	/**
	 * 批量插入,月表
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertMonthBatch(List<AnchorRelateLive> list) throws Exception;

	/**
	 * 统计主播直播时长
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Long countAnchorLiveTime(Map<String, Object> map) throws Exception;

	/**
	 * pk统计主播直播时长
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Long pkCountAnchorLiveTimeByIds(Map<String, Object> map) throws Exception;

	/**
	 * 分页查询主播收益
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<AnchorProfitVO> selectAnchorProfitByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询有效天数
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Integer selectValidDay(Map<String, Object> map) throws Exception;
}
